<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<h2>All Incomes</h2>
<table>
	<tr>
		<th>Id</th>
		<th>User Id</th>
		<th>Book Id</th>
		<th>Return date</th>
		<th>Delay fine</th>
		<th>Damage</th>
	</tr>
	<c:forEach var="record" items="${incomes}">
		<tr>
			<td><c:out value="${record.id}" /></td>
			<td><c:out value="${record.outcome.user.id}" /></td>
			<td><c:out value="${record.outcome.book.id}" /></td>
			<fmt:formatDate value="${record.realReturnDate}" var="realReturnDate" pattern="dd/MM/yyyy" />
			<td><c:out value="${realReturnDate}" /></td>
			<td><c:out value="${record.delayFine}" /></td>
			<td><c:out value="${record.damageFine}" /></td>
			<td>
			 <a href='<spring:url value="/admin/delete_income?id=${record.id}" htmlEscape="true" />'>Delete</a>
			</td>
		</tr>
	</c:forEach>
</table>
